#ifndef __WS2812_H
#define __WS2812_H

#include "stm32f10x_conf.h"
#include "delay.h"

#define MAX_QUANTITY_GRAIN		6


void WS2812_Init(void);
void WS2812_SetQuantity(uint16_t quantity);
uint8_t WS2812_Refresh(void);
void pixel_init(uint16_t num_leds);
uint8_t pixel_set_color_32(uint16_t index, uint32_t c);
uint8_t pixel_set_color(uint16_t index, uint8_t red, uint8_t green, uint8_t blue);
void pixel_set_all_color(uint8_t red, uint8_t green, uint8_t blue);
uint8_t pixel_set_color_and_show(uint16_t index, uint8_t red, uint8_t green, uint8_t blue );
uint8_t sendRGB(uint8_t ln,uint8_t red,uint8_t green,uint8_t blue);
void setBrightness(uint8_t b);
uint8_t getBrightness(void);
void addBrightness(void);
void subBrightness(void);
void pixel_show(void);
void pixel_clear(void);
uint32_t color(uint8_t r, uint8_t g, uint8_t b) ;
void rainbow(uint8_t wait);
uint32_t wheel(uint8_t WheelPos);
void rainbowCycle(uint8_t wait);
void flowing(void);
void close(void);
void breath(void);
void flash(void);
int custom_random(int min, int max);
void random_effect(void);
void random_effect(void);
void redLamp(void);
void orangeLamp(void);
void yellowLamp(void);
void greenLamp(void);
void blueLamp(void);
void wordLamp(void);

#endif

